<?php

namespace mpend\modules\spread\controllers;

use Yii;
use mpend\components\Controller;
use common\logics\ShareLogic;
use mpend\modules\spread\models\SpreadReceiveForm;

/**
 * 通过手机号缓存领取信息接口
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class ReceiveController extends Controller {

    public $closeCheckAuthent = true;

    /**
     * {@inheritdoc}
     */
    protected function verbs() {
        return [
            '*' => ['POST'],
        ];
    }

    /**
     * 领取到日志
     * @inheritdoc
     */
    public function actionIndex() {
        $model = new SpreadReceiveForm();
        $params = Yii::$app->request->post();
        Yii::error($params, __METHOD__);
        if (!$model->load($params, '')) {
            return $model->loadError();
        }
        return $model->bind();
        //领取逻辑
        //判断是否是新用户
        //todo
        return [
            'mobile' => $mobile,
            'user_id' => $user_id,
        ];
    }

}
